package com.ace3l.legal.backend.dao;

import org.springframework.transaction.annotation.Transactional;

import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;

import com.ace3l.legal.backend.domain.LawFirm;
import com.ace3l.legal.backend.domain.User;

/**
 * Created by IntelliJ IDEA.
 * User: ageer
 * Date: Jul 22, 2008
 * Time: 8:33:55 AM
 * To change this template use File | Settings | File Templates.
 */
public class LawFirmDao extends ADao{
    public LawFirm saveLawFirm(LawFirm myLf) {
        entityManager.persist(myLf);
        return myLf;
    }

    public LawFirm getLawFirm(Integer id) {
        Query q = entityManager.createNamedQuery("lawfirm.byid");
        q.setParameter(1, id);
        LawFirm myLawFirm = null;
        try {
            myLawFirm = (LawFirm)q.getSingleResult();
        } catch (Exception e) { }
        return myLawFirm;
    }
}
